//
// Created by denglibin on 2021/6/1.
//

#include "plane.h"
/**
 * 创建
 * @param texture
 * @param w
 * @param h
 * @return
 */
MyPlane* MyPlaneCreate(SDL_Texture* texture, int w, int h, int x, int y){
    MyPlane * myPlane = (MyPlane*)malloc(sizeof(MyPlane));
    myPlane->basePlane.texture = texture;
    myPlane->basePlane.w = w;
    myPlane->basePlane.h = h;
    myPlane->basePlane.x = x;
    myPlane->basePlane.y = y;
    myPlane->basePlane.direction = NONE;

    return myPlane;
}

/**
 * 释放资源
 * @param myPlane
 */
void MyPlaneFree(MyPlane* myPlane){
    SDL_DestroyTexture(myPlane->basePlane.texture);
    free(myPlane);
}

